﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Diagnostics;

namespace IOTest
{
    class Program
    {

        static void Main(string[] args)
        {
            string path = @"D:\";

            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }

            string path2 = path + "\\test.txt";

            if (!File.Exists(path2))
            {
                File.Create(path2);
            }

            StreamWriter streamWriter = new StreamWriter(path2);

            streamWriter.WriteLine("大壮");
            streamWriter.WriteLine("18岁");
            streamWriter.WriteLine("电话：{0}", 110);

            streamWriter.Flush();

            streamWriter.Close();

            Console.ReadKey();
        }
    }
}
